package com.luisliuyi.demo.binder;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.luisliuyi.demo.binderlib.core.BinderIPC;

public class SecondActivity extends Activity {
    ISinglton service = null;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        BinderIPC.getDefault().open(this);

    }

    public void getService(View view) {
//        拿到接口   一定要   服务顾客
        service = BinderIPC.getDefault().getInstance(ISinglton.class);
    }

    public void getUser(View view) {
        Toast.makeText(this, service.getUserInfo().getName() + " : " + service.getUserInfo().getPassword(), Toast.LENGTH_SHORT).show();
    }
}
